﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ckplayer只调用html5播放器2112</title>
</head>
<body>
<div id="a1"></div>
<script type="text/javascript" src="ckplayer/ckplayer.js" charset="utf-8"></script>
<script type="text/javascript">
	var isNumber=true;//定义只判断一次
	var flashvars={
		f:'http://vf3.mtime.cn/Video/2016/04/14/flv/160414173112113429.flv',
		c:0,
		p:1,
		loaded:'loadedHandler'
	};
	var video=['http://movie.ks.js.cn/flv/other/1_0.mp4->video/mp4'];
	CKobject.embed('ckplayer/ckplayer.swf','a1','ckplayer_a1','600','400',false,flashvars,video)	
	function loadedHandler(){
		CKobject.getObjectById('ckplayer_a1').addListener('time','timeHandler');
	}
	function timeHandler(t){
		if(t>10 && isNumber){
			CKobject.getObjectById('ckplayer_a1').videoPause();//暂停播放
			CKobject.getObjectById('ckplayer_a1').removeListener('time','timeHandler');
			isNumber=false;
			CKobject.getObjectById('ckplayer_a1').videoClear();
			//alert('这里的弹出提示代码可以改成执行其它动作的代码');
			//这时是判断当播放时间大于10，并且没有执行过试看判断的情况下进行判断。
			//这里可以弹出登陆层或弹幕提示层
			
		}
	}
</script>



</body>
</html>
